function SuperClass(name){
    this.name = name;
    this.colors = ["blue", "red"];
}

SuperClass.prototype.show = function(){
    alert(this.colors);
}
SuperClass.prototype.toString = function(){
    alert(this.name + ":" + this.age);
}
function SubClass(name, age){
    //继承属性
    SuperClass.call(this, name);
    this.age = age;
}
//继承方法
SubClass.prototype = new SuperClass();

var s1 = new SubClass("小明", 18);
var s2 = new SubClass("张三", 20);

s1.toString();
s2.toString();

s1.colors.push("newColor");
s1.show();
s2.show();
